use crate::types::TResult;
use image::DynamicImage;

/// 将图片存入剪切板
pub fn save_img_to_clipboard(img: &DynamicImage) -> TResult<()> {
    let mut clipboard = clippers::Clipboard::get();
    let img = img.to_rgba8();
    clipboard.write_image(img.width(), img.height(), img.as_raw())?;
    Ok(())
}
